package com.api.sw.duban.model;

import com.api.sw.duban.util.dubanTran;
import weaver.conn.RecordSet;
import weaver.general.Util;

public class WordMode {
    private String key="";//字段
    private String name="";//字段名称

    public WordMode(String key, String name) {
        this.key = key;
        this.name = name;
    }

    public String getKey() {
        return key;
    }

    public void setKey(String key) {
        this.key = key;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }
    public String getValue(RecordSet re){
        String value="";
        dubanTran  DubanTran=new dubanTran();
        if(re!=null&&!"".equals(this.key)){
            if("titileid".equals(this.key)){//事项标题
                //com.api.sw.duban.util.dubanTran.getDubanTitle
                value=DubanTran.getDubanTitleTz(re.getString("titileid"));
            }else if("zbdw".equals(this.key)){//接收部门
                //om.api.sw.duban.util.dubanTran.getSwDpartmentnameByid
                value=DubanTran.getSwDpartmentnameByid(re.getString("zbdw"));
            }else if("sxlb".equals(this.key)){//事项类别
                //com.api.sw.duban.util.dubanTran.getSelectnameByValue
                value=DubanTran.getSelectnameByValue(re.getString("sxlb"),re.getString("tablename"),re.getString("sxlbfield"));
            }else if("xsjs".equals(this.key)){//限时签收
                value= Util.null2String(re.getString("xsjs"));
            }else if("jbsj".equals(this.key)){//交办时间
                value= Util.null2String(re.getString("jbsj"));
            }else if("bjsj".equals(this.key)){//办结时间
                //com.api.sw.duban.util.dubanTran.getBjTime
                value= DubanTran.getBjTime(re.getString("bjsj"),re.getString("id"));
            }else if("status".equals(this.key)){//状态
                //com.api.sw.duban.util.dubanTran.getRwStatus").setOtherpara("column:id")
                value= DubanTran.getRwStatus(re.getString("status"),re.getString("id"));
            }
        }
        return value;
    }
}
